package com.hxzy.mapper;

import com.hxzy.entity.AddressBook;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
* @author Administrator
* @description 针对表【address_book(地址管理)】的数据库操作Mapper
* @createDate 2023-06-28 16:38:44
* @Entity com.hxzy.entity.AddressBook
*/
public interface AddressBookMapper extends BaseMapper<AddressBook> {

    /**
     * 把当前用户所有的默认收货地址设为不默认1
     * @param userId
     * @return
     */
    @Update(value = "update address_book set is_default='1', update_by=#{userName}, update_time=now()  where user_id=#{userId} ")
    int cancelDefaultAddress(@Param(value = "userId") Integer userId, @Param(value = "userName")String userName);

}




